package com.example.manualManagement.controller.user.account;

import com.example.manualManagement.service.user.account.ModiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
public class ModiCtrl {

    @Autowired
    private ModiService modiService;

    @PostMapping("/manage/modify")
    public Map<String, String> modify(@RequestBody Map<String, String> map){
        String userName = map.get("userName");
        String userPassword = map.get("userPassword");
        String newPassword = map.get("newPassword");
        return modiService.modify(userName, userPassword, newPassword);
    }
}
